package com.作业.Day18;

public class Homework3 {
    public static void main(String[] args) {

        for (int i = 0; i <10 ; i++) {
            new Thread(new RunThread()).start();
        }
    }
}
class RunThread implements Runnable{

        static int num=1;
        @Override
        public void run() {

         synchronized (Runnable.class){
             System.out.println(num+"选手拿到接力棒");
             for (int i = 1; i <=10; i++ ) {
                 System.out.println(num + "选手跑了" + i*10 + "米！");

             }
             num++;
         }

        }
    }

